public class Brute {

	private void computeColliniar(Point[] points) {

		for (int i = 0; i < points.length; i++) {
			Point p1 = points[i];
			p1.draw();
			for (int j = 0; j < points.length; j++) {
				Point p2 = points[j];
				if (p1.compareTo(p2) > -1) {
					continue;
				}
				double slopeP1P2 = p2.slopeTo(p1);
				for (int k = 0; k < points.length; k++) {
					Point p3 = points[k];
					if (p2.compareTo(p3) > -1) {
						continue;
					}
					double slopeP3P2 = p3.slopeTo(p2);
					if (slopeP3P2 != slopeP1P2) {
						continue;
					}
					for (int kk = 0; kk < points.length; kk++) {
						Point p4 = points[kk];
						if (p3.compareTo(p4) > -1) {
							continue;
						}
						double slopeP4P3 = p4.slopeTo(p3);
						if (slopeP4P3 != slopeP3P2) {
							continue;
						}
						p4.drawTo(p1);
						StdOut.println(p1 + " -> " + p2 + " ->" + p3 + " ->"
								+ p4);
					}
				}
			}
		}
	}

	private static Point[] getPoints(String file) {
		Point[] points = null;
		try {
			In in = new In(file);
			int n = in.readInt();
			points = new Point[n];
			for (int k = 0; k < n; k++) {
				points[k] = new Point(in.readInt(), in.readInt());
			}
		} catch (Exception e) {
			StdOut.print(e);
		}
		return points;
	}

	private void setUpDrawing() {
		StdDraw.setCanvasSize(640, 480);
		StdDraw.setPenColor(StdDraw.BLACK);
		StdDraw.setXscale(0, 32768);
		StdDraw.setYscale(0, 32768);
	}

	public static void main(String[] args) {
		StdDraw.clear();
		Brute brute1 = new Brute();
		brute1.setUpDrawing();
		brute1.computeColliniar(getPoints(args[0]));
	}
}
